package org.developer.dynamic.api.controller.v1;

import org.developer.dynamic.infra.mapper.CustomerMapper;
import org.developer.dynamic.infra.mapper.EmployeesMapper;
import org.developer.dynamic.infra.util.Results;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
  * 控制器
  *
  * @author yisheng.mikelv@foxmail.com 2020/3/5 15:47
  */
@RestController
public class DemoController {

    private static final Logger logger = LoggerFactory.getLogger(DemoController.class);

    @Autowired
    private CustomerMapper customerMapper;
    @Autowired
    private EmployeesMapper employeesMapper;

    @GetMapping("/queryCustomer")
    public ResponseEntity<?> queryCustomer(){
        return Results.success(customerMapper.selectById());
    }

    @GetMapping("/queryEmployees")
    public ResponseEntity<?> queryEmployees(){
        return Results.success(employeesMapper.getById());
    }

}
